package com.wtone.platform.gat.images.gat.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSort;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.wtone.platform.gat.images.gat.entity.Imagedb;
import com.wtone.platform.gat.images.gat.model.ImageListObject;
import com.wtone.platform.gat.images.gat.model.ResponseStatusListModeObject;
import com.wtone.platform.gat.images.gat.service.ImageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: aiLin
 * @Date: 2020/10/13 15:09
 * @desc:
 */
@Api(tags = "图像相关接口", value = "Image api")
@ApiSort(7)
@RestController
@Slf4j
public class ImageController {

    @Autowired
    private ImageService imageService;

    @ApiOperation("批量图像集合对象新增")
    @ApiOperationSort(value = 1)
    @RequestMapping(value = "/VIID/Images", method = RequestMethod.POST, produces="application/json")
    public ResponseStatusListModeObject addImages(@RequestBody ImageListObject imageListObject){
        return imageService.addImages(imageListObject);
    }

    @ApiOperation("批量图像集合对象查询")
    @ApiOperationSort(value = 2)
    @RequestMapping(value = "/VIID/Images", method = RequestMethod.GET, produces="application/json")
    public List<Imagedb> queryImages(
            @RequestParam(name = "FaceID",required = false) String FaceID,
            @RequestParam(name = "ImageID",required = false) String ImageID){
        return imageService.queryImages(FaceID,ImageID);
    }
}
